﻿namespace WatiNSahi.Extensions
{
    using global::WatiN.Core;

    public static class ImageCollectionExtensions
    {
        public static bool Exists(this ImageCollection imageCollection, string imageIdOrNameOrValueorClass, bool extension = true)
        {
            return imageCollection.Exists(Find.ById(imageIdOrNameOrValueorClass)) ||
                imageCollection.Exists(Find.ByName(imageIdOrNameOrValueorClass)) ||
                imageCollection.Exists(Find.ByValue(imageIdOrNameOrValueorClass)) ||
                imageCollection.Exists(Find.ByClass(imageIdOrNameOrValueorClass)) ||
                imageCollection.Exists(Find.ByLabelText(imageIdOrNameOrValueorClass));
        }
    }
}